/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tienda.vistas;

import alexpaz.clasesbase.FrameBase;
import alexpaz.clasesbase.InternalFrameBase;
import java.awt.event.ActionListener;

/**
 *
 * @author apo
 */
public class FrmPrincipal extends FrameBase {

    /**
     * Creates new form FrmPrincipal
     */
    public FrmPrincipal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlInferior = new javax.swing.JPanel();
        desktop = new javax.swing.JDesktopPane();
        mnbPrincipal = new javax.swing.JMenuBar();
        mnuSistema = new javax.swing.JMenu();
        mniSalir = new javax.swing.JMenuItem();
        mnuMantenimientos = new javax.swing.JMenu();
        mniProductos = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Tienda");

        pnlInferior.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout pnlInferiorLayout = new javax.swing.GroupLayout(pnlInferior);
        pnlInferior.setLayout(pnlInferiorLayout);
        pnlInferiorLayout.setHorizontalGroup(
            pnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 796, Short.MAX_VALUE)
        );
        pnlInferiorLayout.setVerticalGroup(
            pnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 20, Short.MAX_VALUE)
        );

        mnuSistema.setMnemonic('S');
        mnuSistema.setText("Sistema");

        mniSalir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        mniSalir.setText("Salir");
        mnuSistema.add(mniSalir);

        mnbPrincipal.add(mnuSistema);

        mnuMantenimientos.setMnemonic('M');
        mnuMantenimientos.setText("Mantenimientos");

        mniProductos.setText("Productos");
        mnuMantenimientos.add(mniProductos);

        mnbPrincipal.add(mnuMantenimientos);

        setJMenuBar(mnbPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlInferior, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(desktop)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(desktop, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlInferior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        setSize(new java.awt.Dimension(816, 639));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    
    
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane desktop;
    private javax.swing.JMenuBar mnbPrincipal;
    private javax.swing.JMenuItem mniProductos;
    private javax.swing.JMenuItem mniSalir;
    private javax.swing.JMenu mnuMantenimientos;
    private javax.swing.JMenu mnuSistema;
    private javax.swing.JPanel pnlInferior;
    // End of variables declaration//GEN-END:variables

    public void addMniMantenimientoProductosAL(ActionListener actionListener) {
        mniProductos.addActionListener(actionListener);
    }
    
    @Override
    public void addInternalFrame(InternalFrameBase internalFrame) {
        desktop.add(internalFrame);
        internalFrame.setVisible(true);
    }
}
